# -*- coding: utf-8 -*-
# @Time    : 2022/10/24 11:06
# @Author  : 限量老
from django.conf import settings
import hashlib


def md5(data_string):
    #源:settings里有django默认生成随机字符串
    obj=hashlib.md5(settings.SECRET_KEY.encode('utf-8'))

    obj.update(data_string.encode('utf-8'))
    return obj.hexdigest()